#ifndef _DevicesCAN_H_
#define _DevicesCAN_H_

#include "stdint.h"

typedef struct
{
    uint32_t ff : 1;        /* 0:标准帧; 1:拓展帧 */
    uint32_t ft : 1;        /* type of frame, data or remote */
    uint32_t id : 29;
    uint8_t length;         /* 数据长度 */
    uint8_t datas[8];
}CanPackType;


void vCan0Init(void);
void vCan1Init(void);

int8_t cCanxSendDatas(uint32_t can_periph, uint32_t uiID, void *pvDatas, int32_t iLength);

int8_t cCanxReceiveByte(uint32_t can_periph, uint8_t *pucByte);
int8_t cCanxReceiveDatas(uint32_t can_periph, void *pvDatas, int32_t iLength);
int32_t iCanxReceiveAllDatas(uint32_t can_periph, void *pvDatas, int32_t iLengthLimit);
int32_t iCanxReceiveLengthGet(uint32_t can_periph);
int8_t cCanxReceiveClear(uint32_t can_periph);


#endif
